﻿
@{
    Layout = null;
}

<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>绿茶科技后台-登陆页</title>
</head>

<body>
    <div class="container">
        <div class="content">
            <div class="nav_l fl"><a href="http://www.jsgtkj.com/index.html"><img src="/Content/admin/images/logo.jpg" /></a></div>
            <div class="nav_r fr">
                <ul>
                    <li><a href="http://www.jsgtkj.com/index.html">首页</a></li>
                    <li><a href="http://www.jsgtkj.com/about.html">关于我们</a></li>
                    <li><a href="http://www.jsgtkj.com/services.html">我们的服务</a></li>
                    <li><a href="http://www.jsgtkj.com/case.html">客户案例</a></li>
                    <li><a href="http://www.jsgtkj.com/job.html">招贤纳士</a></li>
                    <div class="cl"></div>
                </ul>
            </div>
            <div class="cl"></div>
        </div>
    </div>
    <div class="container login">
        <div class="content">
            <div class="login_t">
                <div class="login_ta">Hi，欢迎登录绿茶科技CRM管理后台</div>
                <table cellpadding="0" cellspacing="0" width="320" border="0">
                    <tr>
                        <td><span class="login_tc"><input type="text" id="txtName" class="login_tb" placeholder="用户名" /></span></td>
                    </tr>
                    <tr>
                        <td><span class="login_td"><input type="password" id="txtPwd" class="login_tb" placeholder="密码" /></span></td>
                    </tr>
                    <tr>
                        <td><a href="javascript:" onclick="getKey()" class="login_te">登 录</a></td>
                    </tr>
                    @*<tr>
                            <td>
                               <span class="fl"><input type="checkbox" />记住密码</span>
                                <span class="fr" style="text-decoration:underline;"><a href="/Login/ForGetPwd">忘记密码？</a></span>
                            </td>
                        </tr>*@
                </table>
            </div>
        </div>
    </div>
    <div class="container foot">
        <div class="content">
            COPYRIGHT © 2016 ALL RIGHTS RESERVED JSGTKJ.COM | 苏ICP备14030286
        </div>
    </div>
</body>
</html>
<link href="/Scripts/layer/skin/default/layer.css" rel="stylesheet" />
<script src="/Scripts/jquery-1.10.2.js"></script>
@*<script src="~/Content/layui/layui.js"></script>*@
<script src="/Scripts/layer/layer.js"></script>
<link href="/Content/admin/css/style.css" rel="stylesheet" />
<script src="/Scripts/DesCrypt.js"></script>
<script>
    var key;
    function getKey() {
        $.get('/AdminInfo/AdminLogin/GetScuerKey', function (data) {
            key = data;
            login();
        })
    }
    function login() {

        if ($('#txtName').val() == "") {
            layer.msg('<span style=" color:black">用户名不得为空</span>', { icon: 0, time: 3000 });
            return;
        } else if ($('#txtPwd').val() == "") {
            layer.msg('<span style=" color:black">密码不得为空</span>', { icon: 0, time: 3000 });
            return;
        }
        var Name = $('#txtName').val();
        var Pwd = $('#txtPwd').val();
        var desc = jsencrypt(key, Pwd);
        $.ajax({
            url: '/AdminInfo/AdminLogin/GetLogin',
            type: "post",
            dataType: 'json',
            data: { Name: Name, Password: desc },
            cache: false,
            async: true,
            success: function (data) {
                if (data.success) {
                    window.location.href = "/AdminInfo/AdminMain/Main";
                } else {
                    //layer.alert(data.message, {
                    //    skin: 'layui-layer-molv' //样式类名
                    //    , closeBtn: 0
                    //});
                    layer.msg('<span style=" color:black">' + data.message + '</span>', { icon: 0, time: 3000 });
                    //layer.msg();
                    //layer.msg('<span style=" color:black">' + data.message + '</span>', { icon: 0, time: 3000 });
                    //$('#img').click();
                }
            }
        });
    }
</script>


